import { createApp } from 'vue'
import pinia from './store'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import gloablComponent from '@/components'
import '@/styles/tailwind.css'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// svg插件需要配置代码
import 'virtual:svg-icons-register'
// 黑暗模式
import 'element-plus/theme-chalk/dark/css-vars.css'
import vLazy from '@/directives/vLazy'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus, {
  locale: zhCn
})
app.directive('lazy', vLazy)
app.use(gloablComponent)
//安装仓库
app.use(pinia)
app.use(router)
app.mount('#app')
